package com.ruoyi.financial.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.financial.domain.TCwClearing;
import com.ruoyi.financial.mapper.TCwClearingMapper;
import com.ruoyi.financial.service.ITCwClearingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 结算Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-06-22
 */
@Service
public class TCwClearingServiceImpl implements ITCwClearingService
{
    @Autowired
    private TCwClearingMapper tCwClearingMapper;

    /**
     * 查询结算
     * 
     * @param id 结算ID
     * @return 结算
     */
    @Override
    public TCwClearing selectTCwClearingById(Long id)
    {
        return tCwClearingMapper.selectTCwClearingById(id);
    }

    /**
     * 查询结算列表
     * 
     * @param tCwClearing 结算
     * @return 结算
     */
    @Override
    public List<TCwClearing> selectTCwClearingList(TCwClearing tCwClearing)
    {
        return tCwClearingMapper.selectTCwClearingList(tCwClearing);
    }

    /**
     * 新增结算
     * 
     * @param tCwClearing 结算
     * @return 结果
     */
    @Override
    public int insertTCwClearing(TCwClearing tCwClearing)
    {
        tCwClearing.setCreateTime(DateUtils.getNowDate());
        return tCwClearingMapper.insertTCwClearing(tCwClearing);
    }

    /**
     * 修改结算
     * 
     * @param tCwClearing 结算
     * @return 结果
     */
    @Override
    public int updateTCwClearing(TCwClearing tCwClearing)
    {
        tCwClearing.setUpdateTime(DateUtils.getNowDate());
        return tCwClearingMapper.updateTCwClearing(tCwClearing);
    }

    /**
     * 批量删除结算
     * 
     * @param ids 需要删除的结算ID
     * @return 结果
     */
    @Override
    public int deleteTCwClearingByIds(Long[] ids)
    {
        return tCwClearingMapper.deleteTCwClearingByIds(ids);
    }

    /**
     * 删除结算信息
     * 
     * @param id 结算ID
     * @return 结果
     */
    @Override
    public int deleteTCwClearingById(Long id)
    {
        return tCwClearingMapper.deleteTCwClearingById(id);
    }
}
